Append a '/' to directory names in the completion popup. (#431323, Maarten
authorMatthias Clasen <mclasen@redhat.com>
Thu, 26 Apr 2007 17:04:33 +0000 (17:04 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 26 Apr 2007 17:04:33 +0000 (17:04 +0000)
2007-04-26  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserentry.c: Append a '/' to directory names
        in the completion popup.  (#431323, Maarten Maathuis)

svn path=/trunk/; revision=17658

ChangeLog
gtk/gtkfilechooserentry.c

index 384e05adc3f95ef64e8b55d23bdc605b5988ea19..454797b6a3ecbffdd1125217ddbe1d45dbb2d20a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-26  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkfilechooserentry.c: Append a '/' to directory names
+       in the completion popup.  (#431323, Maarten Maathuis)
+
 2007-04-26  Matthias Clasen  <mclasen@redhat.com>
 
        * demo/gtk-demo/combobox.c: Add a simple validation demo. 
index b5c12f0b47e107b88b874735e4344a3f83b6f522..24bbc5f32e490d3e35da3cac88ffd2fa1358bdbf 100644 (file)
@@ -359,7 +359,7 @@ maybe_append_separator_to_path (GtkFileChooserEntry *chooser_entry,
                                GtkFilePath         *path,
                                gchar               *display_name)
 {
-  if (path)
+  if (!g_str_has_suffix (display_name, G_DIR_SEPARATOR_S) && path)
     {
       GtkFileInfo *info;
            
@@ -377,7 +377,6 @@ maybe_append_separator_to_path (GtkFileChooserEntry *chooser_entry,
          
          gtk_file_info_free (info);
        }
-
     }
 
   return display_name;
@@ -572,9 +571,11 @@ update_current_folder_files (GtkFileChooserEntry *chooser_entry,
                                       NULL); /* NULL-GError */
       if (info)
        {
-         const gchar *display_name = gtk_file_info_get_display_name (info);
+         gchar *display_name = g_strdup (gtk_file_info_get_display_name (info));
          GtkTreeIter iter;
 
+          display_name = maybe_append_separator_to_path (chooser_entry, path, display_name);
+
          gtk_list_store_append (chooser_entry->completion_store, &iter);
          gtk_list_store_set (chooser_entry->completion_store, &iter,
                              DISPLAY_NAME_COLUMN, display_name,
@@ -582,6 +583,7 @@ update_current_folder_files (GtkFileChooserEntry *chooser_entry,
                              -1);
 
          gtk_file_info_free (info);
+          g_free (display_name);
        }
     }